<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>意见反馈</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <style>
        html,
        body {
            background: #FAF9F9;
        }

        .wrap {
            width: 100%;
            padding: 0 15px;
            overflow: hidden;
        }

        .wrap_inner {
            width: 100%;
            padding-bottom: 10px;
            overflow: hidden;
        }

        .box_input {
            width: 100%;
            height: 136px;
            background: #FFFFFF;
            border-radius: 5px;
            margin-top: 10px;
        }

        .box_input textarea {
            font-size: 14px;
            height: 120px;
            font-family: PingFang SC;
            font-weight: 400;
            display: block;
            padding: 7px;
        }
        .word_sapce{
          height: 18px;
          font-size: 13px;
          font-family: PingFang SC;
          font-weight: 500;
          color: #333333;
          line-height: 18px;
          text-align: right;
          margin-top: 10px;
        }
        .add_picture{
          width: 100%;
          overflow: hidden;
          background: #fff;
          border-radius: 10px;
          padding: 7px 7px 13px 7px;
          box-sizing: border-box;
          margin-top: 10px;
        }
        .add_picture .title{

            height:18px;
            font-size: 12px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #333333;
            line-height: 18px;
        }
        .del-bg {
            width: 18px;
            height: 18px;
            /*border-radius: 5px;*/
            background-image: url(../../image/remove.png);
            background-repeat: no-repeat;
            background-position: right;
            background-size: 18px 18px;
            /*background-color: #000;*/
            opacity: 0.5;
            position: absolute;
            right: -3px;
            top: -1px;
            margin-right: 0.125rem;
        }
        .submit{
          width: 100%;
          height: 40px;
          background-image: linear-gradient(134deg, #FFC12B 0%, #FF8D13 100%);
          box-shadow: 0 2px 4px 0 rgba(255, 144, 20, 0.30);
          border-radius: 22.5px;
          margin-top: 53px;
          line-height: 40px;
          text-align: center;
          color: #fff;
          font-size: 16px;
          font-family: PingFang SC;
          font-weight: 500;
        }
    </style>
</head>

<body>
    <div class="wrap" id="app">
        <div class="wrap_inner">
            <div class="box_input">
                <textarea name="name" rows="8" cols="80" v-model='content'  placeholder="请在此输入您的宝贵意见，APP使用体验、优化建议都可以告诉我" @input='change()'></textarea>
            </div>
            <div class="word_sapce">您还能输入{{content_length}}个字</div>

          <!-- <div class="add_picture">
               <div class="title">点击添加图片</div>
               <div class="aui-row aui-row-padded">
                   <div class="aui-col-xs-3 upload-file" v-for="(vo,index) in thumbImg" style="padding-top:8px;">
                       <div class="del-bg" tapmode @click="deleteImage(index);"></div>
                       <img :src="vo" tapmode @click="openPhotoBrowser(index);">
                   </div>
                   <div class="aui-col-xs-3 upload-file" tapmode @click="addPhoto();" style="padding-top:8px;">
                       <img style="width: 100%;" class="add-image-bg" src="../../image/addpersoninfo.png" alt="">
                   </div>
               </div>
          </div> -->

          <div class="submit" @click='submit()'>提交</div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/cling.js"></script>
<script type="text/javascript">
    apiready = function() {

    }

    var vm = new Vue({
        el: "#app",
        data: {
            content: '',
            content_length:300
        },
        methods: {
            change: function() {
                console.log(vm.content.length);

                if (vm.content.length > 300) {

                    vm.content = vm.content.substr(0, 300);

                } else {
                    vm.content_length = 300-vm.content.length;
                }
            },
            submit: function() {
                if (!vm.content) {
                    cl.toast({
                        msg: "请输入反馈内容"
                    })
                    return;
                }
                api.ajax({
                    url: cl.apiServer + 'feedback/saveFeedBack',
                    method: 'post',
                    headers: {
                        'Content-Type': 'application/json;charset=utf-8',
                        token:cl.userToken
                    },
                    data: {
                        body: {
                            content:vm.content,
                            mid:cl.mid,
                            version:cl.deviceInfo().appVersion,
                            mobileInfo:cl.systemType()
                        }
                    }
                }, function(ret, err) {
                    if (ret.code == 0) {
                      console.log(JSON.stringify(ret));
                        cl.openWin({
                            name: 'order_comment_status'
                        })
                    }
                })
            }
        }
    })
</script>

</html>
